<%--
  Created by IntelliJ IDEA.
  User: 门铎
  Date: 2016/6/23
  Time: 10:41
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html lang="en">
    <head>
        <title>登录</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <!-- BOOTSTRAP STYLES-->
        <link href="${pageContext.request.contextPath}/css/bootstrap.css" rel="stylesheet" />
        <!-- FONTAWESOME STYLES-->
        <link href="${pageContext.request.contextPath}/css/font-awesome.css" rel="stylesheet" />

        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    </head>
    <body style="background-color: #E2E2E2;">
    <div class="container">
        <div class="row text-center " style="padding-top:100px;">
            <div class="col-md-12">
                <img src="${pageContext.request.contextPath}/img/logo-invoice.png" />
            </div>
        </div>
        <div class="row ">

            <div class="col-md-4 col-md-offset-4 col-sm-6 col-sm-offset-3 col-xs-10 col-xs-offset-1">
                <form action="${pageContext.request.contextPath}/cimv/login" id="LoginForm" method="post">
                    <div class="panel-body">

                        <hr />
                        <h5 id="msg">${information.message}</h5>
                        <br />
                        <div class="form-group input-group">
                            <span class="input-group-addon"><i class="fa fa-tag"  ></i></span>
                            <input type="text" name="username" id="username" class="form-control" placeholder="登录名" />
                        </div>
                        <div class="form-group input-group">
                            <span class="input-group-addon"><i class="fa fa-lock"  ></i></span>
                            <input type="password" name="password" id="password" class="form-control"  placeholder="密码" />
                        </div>
                        <a  id="LoginFormA"  class="btn btn-primary ">登录</a>
                    </div>
                </form>
            </div>
        </div>
    </div>

    </body>
    <script src="${pageContext.request.contextPath}/js/jquery-1.10.2.js"></script>
    <script>
        $(function () {
            $("#username").focus();
        });


        function submitLoginForm(){
            var username = $("#username").val();
            var password = $("#password").val();
            if(username.trim()==""||password.trim()==""){
                $("#msg").html("请输入用户名和密码！");
                if(username.trim()==""){
                    $("#username").focus();
                }else{
                    $("#password").focus();
                }
                return ;
            }
            $("#LoginForm").submit();
        }



        $(function () {
            $(document).keydown(function(event){
                if(event.keyCode==13){
                    $("#LoginFormA").click();
                }
            });
            $('#LoginFormA').click(function() {
                submitLoginForm();
            });
        });
    </script>
</html>

